package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.ContactsInfoMapper;
import com.ly.heart.domain.ContactsEntity;
import com.ly.heart.service.IContactsInfoService;

/**
 * 客户更多联系人Service业务层处理
 *
 * @author cxl
 * @date 2024-05-14
 */
@Service
public class ContactsInfoServiceImpl extends ServiceImpl<ContactsInfoMapper,ContactsEntity> implements IContactsInfoService
{
    @Autowired
    private ContactsInfoMapper contactsEntityMapper;

    /**
     * 查询客户更多联系人
     *
     * @param id 客户更多联系人主键
     * @return 客户更多联系人
     */
    @Override
    public ContactsEntity selectContactsEntityById(String id)
    {
        return contactsEntityMapper.selectContactsEntityById(id);
    }

    /**
     * 查询客户更多联系人列表
     *
     * @param contactsEntity 客户更多联系人
     * @return 客户更多联系人
     */
    @Override
    public List<ContactsEntity> selectContactsEntityList(ContactsEntity contactsEntity)
    {
        return contactsEntityMapper.selectContactsEntityList(contactsEntity);
    }

    /**
     * 新增客户更多联系人
     *
     * @param contactsEntity 客户更多联系人
     * @return 结果
     */
    @Override
    public int insertContactsEntity(ContactsEntity contactsEntity)
    {
        contactsEntity.setCreateTime(DateUtils.getNowDate());
        return contactsEntityMapper.insertContactsEntity(contactsEntity);
    }

    /**
     * 修改客户更多联系人
     *
     * @param contactsEntity 客户更多联系人
     * @return 结果
     */
    @Override
    public int updateContactsEntity(ContactsEntity contactsEntity)
    {
        return contactsEntityMapper.updateContactsEntity(contactsEntity);
    }

    /**
     * 批量删除客户更多联系人
     *
     * @param ids 需要删除的客户更多联系人主键
     * @return 结果
     */
    @Override
    public int deleteContactsEntityByIds(String[] ids)
    {
        return contactsEntityMapper.deleteContactsEntityByIds(ids);
    }

    /**
     * 删除客户更多联系人信息
     *
     * @param id 客户更多联系人主键
     * @return 结果
     */
    @Override
    public int deleteContactsEntityById(String id)
    {
        return contactsEntityMapper.deleteContactsEntityById(id);
    }
}
